package chapter11_2.action;

import chapter11_2.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Controller
public class CustomerAction {
    //@Autowired
    @Resource
    public CustomerService customerService;
    //查看所有客户信息
    @RequestMapping("/custList.do")
    private String getCustomerList(Model model){
        List<Map<String, Object>> custList1 = customerService.findAllCust();
        model.addAttribute("custList2",custList1);
        return "customerList";
    }
}
